package hashMapDemo;

import java.util.HashMap;
import java.util.Scanner;

public class Demo2 {
	public static void main(String[] args){
		HashMap hashMap = new HashMap();
		hashMap.put("fuck", new User("fuck", "fuck", 100.0));
		hashMap.put("徐志摩",new User("徐志摩", "123", 520.0));
		hashMap.put("国学大师", new User("XXOO", "123456", 0.0));
		Scanner scanner = new Scanner(System.in);
		while(true){
			System.out.println("username");
			String name = scanner.nextLine();
			System.out.println("pwd");
			String pwd = scanner.nextLine();
			if(!hashMap.containsKey(name)){
				System.out.println("none");
				continue;
			}
			User user = (User)hashMap.get(name);
			if(pwd.equals(user.getPwd())){
				System.out.println("success");
				break;
			}
		}
	}
}
class User{
	private String username;
	private String pwd;
	private double money;
	public User(String username, String pwd, double money) {
		super();
		this.username = username;
		this.pwd = pwd;
		this.money = money;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public double getMoney() {
		return money;
	}
	public void setMoney(double money) {
		this.money = money;
	}
	
}
